  // 折线图函数
  function loadLine(xAxisData, yAxisData) {
    var lineChart = echarts.init(document.getElementById('lineEchart'));
    var lineOption = {
      tooltip: {
        trigger: 'axis'
      },
      yAxis: {
        type: 'value',
        name: '耗时',
      },
      xAxis: {
        type: 'category',
        name: '日期',
        data: xAxisData,
        axisLabel: {
          rotate: 30, // 刻度标签旋转的角度
          overflow: 'truncate',
          ellipsis: '...',
        },
      },
      series: [
        {
          data: yAxisData,
          type: 'line',
        },
      ]
    }
    lineOption && lineChart.setOption(lineOption);
  }

  // 饼图函数
  function loadPart(data) {
    const partChart = echarts.init(document.getElementById('partEchart'));
    const colorList = [
      '#72DDB2',
      '#EB7E66',
      '#0091FF',
      '#F6C638',
      '#6DD400',
      '#32C5FF',
      '#FF1493',
      '#B03060',
      '#FF00FF',
      '#9932CC',
      '#556B2F',
      '#EE30A7',
      '#8B2500',
      '#FFC125',
      '#228B22',
      '#48D1CC',
      '#7FFF00',
      '#20B2AA',
    ];
    var partOption = {
      tooltip: {
        trigger: 'item',
        formatter: '{b}: {c} ({d}%)',
      },
      toolbox: {
        show: true,
      },
      series: [
        {
          name: 'Access From',
          type: 'pie',
          radius: '50%', // 饼图的半径，外半径为可视区尺寸（容器高宽中较小一项）的 55% 长度。
          seriesLayoutBy: 'row',
          data: data,
          top: 10,
          label: {
            formatter: '{b}:{c}\n({per|{d}%})',
            rich: {
              a: {
                lineHeight: 22,
                // align: 'center'
              },
              b: {
                fontSize: 14,
                lineHeight: 33,
              },
              per: {
                color: function (params) {
                  return colorList[params.dataIndex];
                },
                padding: [3, 4],
                borderRadius: 4,
              },
            },
          },
          itemStyle: {
            normal: {
              color: function (params) {
                // 自定义颜色
                return colorList[params.dataIndex];
              },
            },
          },
          labelLine: {
            length: 15,
          },
        },
      ]
    };
    partOption && partChart.setOption(partOption);
  }